import { fillStyle, clearStyle } from './fillStyle'

function transparent(node) {
  if(!(node instanceof Node)) {
    console.error(`disappear: node-${node} is not a Node`);
    return;
  }

  fillStyle(node, {
    opacity: '0',
    pointerEvent: 'none'
  });
}

function untransparent(node) {
  if(!(node instanceof Node)) {
    console.error(`appear: node-${node} is not a Node`);
    return;
  }

  clearStyle(node, ['opacity', 'pointerEvent']);
}

function disappear(node) {
  if(!(node instanceof Node)) {
    console.error(`appear: node-${node} is not a Node`);
    return;
  }

  fillStyle(node, {
    display: 'none'
  });
}

function appear(node) {
  if(!(node instanceof Node)) {
    console.error(`disappear: node-${node} is not a Node`);
    return;
  }

  fillStyle(node, {
    display: 'block'
  });
}

export {
  transparent,
  untransparent,
  disappear,
  appear
}